package top.mcwebsite.playandroid.lib.markdown.render

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import org.intellij.markdown.ast.ASTNode
import top.mcwebsite.playandroid.lib.markdown.BlockVerticalPadding

@Composable
fun BlockQuote(
    markdownState: MarkdownState,
    astNode: ASTNode,
) {
    Row(
        modifier = Modifier
            .padding(vertical = BlockVerticalPadding)
            .background(color = Color.Gray.copy(alpha = 0.05f))
            .fillMaxWidth()
            .height(IntrinsicSize.Min)
    ) {
        Box(
            modifier = Modifier
                .background(color = Color.Gray.copy(alpha = 0.2f))
                .width(5.dp)
                .fillMaxHeight()
        )
        Spacer(modifier = Modifier.width(7.dp))
        Column {
            for (node in astNode.children)
                RenderMap(markdownState = markdownState, astNode = node)
        }
    }
}